﻿<%@ Page Title="关键字" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" CodeBehind="ViewKeyword.aspx.cs" Inherits="RegexLib.Web.Views.Keywords.ViewKeyword" %>
<asp:Content ID="Content1" ContentPlaceHolderID="headContentPlaceHolder" runat="server">
	<link rel="Stylesheet" type="text/css" href="/Content/styles/RxView.css"/>
</asp:Content>
<asp:Content ContentPlaceHolderID="LeftBar1ContentPlaceHolder" runat="server">
<div class="box">
<% KeywordInfo[] relativeKeywords = (KeywordInfo[])ViewData["RelativeKeywords"]; %>
	<div class="bt">相关关键字</div>
	<div class="bc">
<% if (relativeKeywords != null) %>
<% { %>
	<% for (int i = 0; i < relativeKeywords.Length; i++) %>
	<% { %>
		<% KeywordInfo keyword = relativeKeywords[i]; %>
		<a href='<%= RxUrl.GetViewKeywordUrl(keyword.Text) %>'><%= HttpUtility.HtmlEncode(keyword.Text)%></a>
		<% if (i < relativeKeywords.Length - 1) %>
		<% { %>
			|
		<% } %>
	<% } %>
<% } %>
	</div>
</div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<% int pageIndex = (int)ViewData["PageIndex"]; %>
<% int pageSize = (int)ViewData["PageSize"]; %>
<% int totalPages = (int)ViewData["TotalPages"]; %>
<% KeywordInfo keyword = (KeywordInfo)ViewData["Keyword"]; %>
<% RegexInfo[] regexes = (RegexInfo[])ViewData["Regexes"]; %>
<% UserInfo contributedUser = (UserInfo)ViewData["ContributedUser"]; %>
<div class="box">
	<div class="bt">关键字：<%= HttpUtility.HtmlEncode(keyword.Text) %></div>
	<div class="bc">
		<p>该关键字由
		<a href='<%= RxUrl.GetUserUrl(contributedUser.AccessKey) %>'>
			<%= HttpUtility.HtmlEncode(contributedUser.Nickname) %>
		</a>
		于<%= keyword.FirstAddedTime.ToString("yyyy-MM-dd HH:mm:ss") %>首次使用。</p>
		<div class="ad-c"><%= RxAdsUtility.GetAdsCode("inpage") %></div>
<% foreach (var rx in regexes) %>
<% { %>
		<h3><a href='<%= RxUrl.GetViewRegexUrl(rx.AccessKey) %>'><%= HttpUtility.HtmlEncode(rx.Title) %></a></h3>
		<p><%= HttpUtility.HtmlEncode(rx.Description.LimitLength(200)) %></p>
		<hr />
<% } %>
<% for (int pi = 1; pi <= totalPages; pi++) %>
<% { %>
	<% if (pi == pageIndex) %>
	<% { %>
		<span class="rx-curpg"><%= pi %></span>
	<% } %>
	<% else %>
	<% { %>
		<span class="rx-pg"><a href='<%= RxUrl.GetViewKeywordUrl(keyword.Text, pi, pageSize) %>'><%= pi %></a></span>
	<% } %>
<% } %>
	</div>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
</asp:Content>
